﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.factory.ui {
    import flash.display.*;
    import Display.DialogUI.*;
    import org.aswing.*;
    import Classes.*;
    import Display.aswingui.*;

    public class WorkerCell extends CrewCell {

        protected var m_layoutInfoPanel:Function;

        public function WorkerCell(_arg1:CrewCellFactory, _arg2:LayoutManager=null){
            super(_arg1, _arg2);
        }
        public function get position():String{
            return (m_cellData.position);
        }
        public function get friendName():String{
            return (m_cellData.friendName);
        }
        override protected function makeInfoPanel():JPanel{
            var _local5:JTextField;
            var _local6:JPanel;
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.LEFT);
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            var _local3:JPanel;
            var _local4:JTextField = ASwingHelper.makeTextField((this.position.toUpperCase() + " "), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 14, EmbeddedArt.darkBlueTextColor);
            if (this.friendName){
                _local5 = ASwingHelper.makeTextField((this.friendName + " "), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, EmbeddedArt.darkBrownTextColor);
            } else {
                _local5 = ASwingHelper.makeTextField((ZLoc.t("Dialogs", "EmptyCrewCell") + " "), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, EmbeddedArt.blueTextColor);
                _local3 = this.makeRewardPanel();
            };
            _local2.appendAll(_local4, _local5);
            _local1.append(_local2);
            if (_local3){
                ASwingHelper.prepare(_local2, _local3);
                _local6 = ASwingHelper.horizontalStrut(((((m_factory.preferredCellWidth - m_imagePanel.getWidth()) - _local2.getWidth()) - _local3.getWidth()) - 15));
                _local1.appendAll(_local6, _local3);
            };
            return (_local1);
        }
        protected function makeRewardPanel():JPanel{
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            var _local3:AssetPane = new AssetPane((new (m_factory.assets["cell_goods"])() as DisplayObject));
            _local2.append(_local3);
            var _local4:JLabel = ASwingHelper.makeLabel(m_factory.assets.stringAssets.workerBonusText, EmbeddedArt.TITLE_FONT, 14, EmbeddedArt.greenTextColor);
            _local1.appendAll(_local2, _local4);
            return (_local1);
        }

    }
}//package Modules.factory.ui 
